package com.cq.smartelebicycle.fragment;


import java.util.Calendar;

import com.cq.smartelebicycle.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TimePicker;


public class DateSettingsFragment extends Fragment implements OnClickListener{
	
	public static final String TAG_ID = "DateSettingsFragment";
	
    private DatePicker mDatePicker = null;
    private TimePicker mTimePicker = null;
    
    private Button mEnter = null;

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View rootView = inflater.inflate(R.layout.date_settings_fragment, container,
				false);
		initView(rootView);
		return rootView;
	}
	
	private void initView(View rootView){
		mDatePicker = (DatePicker) rootView.findViewById(R.id.date_picker);
		mTimePicker = (TimePicker) rootView.findViewById(R.id.time_picker);
		Calendar cal = Calendar.getInstance();
        cal.setTimeInMillis(System.currentTimeMillis());
        mDatePicker.init(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH), null);
        mTimePicker.setIs24HourView(true);
        mTimePicker.setCurrentHour(cal.get(Calendar.HOUR_OF_DAY));
        mTimePicker.setCurrentMinute(cal.get(Calendar.MINUTE));     
        mEnter = (Button)  rootView.findViewById(R.id.enter_bt);
        mEnter.setOnClickListener(this);
	}

	@Override
	public void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	public void onDestroyView() {
		// TODO Auto-generated method stub
		super.onDestroyView();
	}

	@Override
	public void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	@Override
	public void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	public void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
	}

	@Override
	public void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}
	
}
